package jdly.water.api.service.data;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import jdly.water.api.common.service.R;
import jdly.water.api.dao.common.BaseDAO;
import jdly.water.api.model.PageModel;
import jdly.water.entity.datasearch.ReadData;
import jdly.water.entity.datasearch.ReadDataMonitor;

@Service
public class DataService {

	@Autowired
	public BaseDAO<ReadData,String> dataDao;
	
	@Autowired
	public BaseDAO<ReadDataMonitor,String> monitorDao;
	
	
	public R metermonitor(LinkedHashMap<String,Object> param,Map<String,String> sortmap,PageModel page,Map<String,Object> beginmap,Map<String,Object> endmap) {
		R  r = R.ok();
		List<ReadDataMonitor> datalist= monitorDao.findByMoreFiledpages("ReadDataMonitor", param, page.getPage(), page.getLimit(),sortmap,beginmap,endmap);
		r.put("datalist",datalist);
		return r;
	}
	
	
	public R bmetermonitor(LinkedHashMap<String,Object> param,Map<String,String> sortmap,PageModel page,Map<String,Object> beginmap,Map<String,Object> endmap) {
		R  r = R.ok();
		List<ReadDataMonitor> datalist= monitorDao.findByMoreFiledpages("ReadDataBmMonitor", param, page.getPage(), page.getLimit(),sortmap,beginmap,endmap);
		r.put("datalist",datalist);
		return r;
	}
	
}
